﻿package plugin.fcactivity
{
    import com.core.*;

    public class FCActivityUtil extends Object
    {

        public function FCActivityUtil()
        {
            return;
        }// end function

        public static function checkLimit(param1:int, param2:int) : Boolean
        {
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            switch(param1)
            {
                case 8:
                {
                    _loc_3 = UserData.getUserData("level");
                    if (_loc_3 >= param2)
                    {
                        return true;
                    }
                    break;
                }
                case 9:
                {
                    _loc_4 = UserData.getUserData("rein");
                    if (_loc_4 >= param2)
                    {
                        return true;
                    }
                    break;
                }
                case 10:
                {
                    _loc_5 = ModelProxy.getValue("data", "logindaycount");
                    if (_loc_5 >= param2)
                    {
                        return true;
                    }
                    break;
                }
                default:
                {
                    break;
                }
            }
            return false;
        }// end function

        public static function checkCanGet() : void
        {
            var _loc_2:String = null;
            var _loc_3:Object = null;
            var _loc_1:* = ModelProxy.getValue("data", "jingjitypedata");
            if (_loc_1)
            {
                for (_loc_2 in _loc_1)
                {
                    
                    if (_loc_2 == "9" || _loc_2 == "10")
                    {
                        for each (_loc_3 in _loc_1[_loc_2][0])
                        {
                            
                            if (checkLimit(_loc_3.pkType, _loc_3.goal))
                            {
                                if (_loc_3.isGet == 0)
                                {
                                    ModelProxy.change("mainui", "showEffect", {ab:"fcactivity", state:true});
                                    return;
                                }
                            }
                        }
                    }
                }
                ModelProxy.change("mainui", "showEffect", {ab:"fcactivity", state:false});
            }
            return;
        }// end function

    }
}
